package com.jy.users.service.impl;

import java.util.List;
import com.jy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jy.users.mapper.LibraryUsersMapper;
import com.jy.users.domain.LibraryUsers;
import com.jy.users.service.ILibraryUsersService;

/**
 * 用户Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-29
 */
@Service
public class LibraryUsersServiceImpl implements ILibraryUsersService 
{
    @Autowired
    private LibraryUsersMapper libraryUsersMapper;

    /**
     * 查询用户
     * 
     * @param userId 用户主键
     * @return 用户
     */
    @Override
    public LibraryUsers selectLibraryUsersByUserId(Long userId)
    {
        return libraryUsersMapper.selectLibraryUsersByUserId(userId);
    }

    /**
     * 查询用户列表
     * 
     * @param libraryUsers 用户
     * @return 用户
     */
    @Override
    public List<LibraryUsers> selectLibraryUsersList(LibraryUsers libraryUsers)
    {
        return libraryUsersMapper.selectLibraryUsersList(libraryUsers);
    }

    /**
     * 新增用户
     * 
     * @param libraryUsers 用户
     * @return 结果
     */
    @Override
    public int insertLibraryUsers(LibraryUsers libraryUsers)
    {
        libraryUsers.setCreateTime(DateUtils.getNowDate());
        return libraryUsersMapper.insertLibraryUsers(libraryUsers);
    }

    /**
     * 修改用户
     * 
     * @param libraryUsers 用户
     * @return 结果
     */
    @Override
    public int updateLibraryUsers(LibraryUsers libraryUsers)
    {
        libraryUsers.setUpdateTime(DateUtils.getNowDate());
        return libraryUsersMapper.updateLibraryUsers(libraryUsers);
    }

    /**
     * 批量删除用户
     * 
     * @param userIds 需要删除的用户主键
     * @return 结果
     */
    @Override
    public int deleteLibraryUsersByUserIds(Long[] userIds)
    {
        return libraryUsersMapper.deleteLibraryUsersByUserIds(userIds);
    }

    /**
     * 删除用户信息
     * 
     * @param userId 用户主键
     * @return 结果
     */
    @Override
    public int deleteLibraryUsersByUserId(Long userId)
    {
        return libraryUsersMapper.deleteLibraryUsersByUserId(userId);
    }
}
